package com.hello.system.service.impl;

import java.util.List;
import com.hello.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hello.system.mapper.PointsPackageMapper;
import com.hello.system.domain.PointsPackage;
import com.hello.system.service.IPointsPackageService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 积分充值套餐Service业务层处理
 * 
 * @author hello
 * @date 2025-10-29
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class PointsPackageServiceImpl extends ServiceImpl<PointsPackageMapper, PointsPackage> implements IPointsPackageService 
{
    private final PointsPackageMapper pointsPackageMapper;

    /**
     * 查询积分充值套餐
     * 
     * @param packageId 积分充值套餐主键
     * @return 积分充值套餐
     */
    @Override
    public PointsPackage selectPointsPackageByPackageId(Long packageId)
    {
        return pointsPackageMapper.selectPointsPackageByPackageId(packageId);
    }

    /**
     * 查询积分充值套餐列表
     * 
     * @param pointsPackage 积分充值套餐
     * @return 积分充值套餐
     */
    @Override
    public List<PointsPackage> selectPointsPackageList(PointsPackage pointsPackage)
    {
        return pointsPackageMapper.selectPointsPackageList(pointsPackage);
    }

    /**
     * 新增积分充值套餐
     * 
     * @param pointsPackage 积分充值套餐
     * @return 结果
     */
    @Override
    public int insertPointsPackage(PointsPackage pointsPackage)
    {
        pointsPackage.setCreateTime(DateUtils.getNowDate());
        return pointsPackageMapper.insertPointsPackage(pointsPackage);
    }

    /**
     * 修改积分充值套餐
     * 
     * @param pointsPackage 积分充值套餐
     * @return 结果
     */
    @Override
    public int updatePointsPackage(PointsPackage pointsPackage)
    {
        pointsPackage.setUpdateTime(DateUtils.getNowDate());
        return pointsPackageMapper.updatePointsPackage(pointsPackage);
    }


    /**
     * 批量删除积分充值套餐
     * 
     * @param packageIds 需要删除的积分充值套餐主键
     * @return 结果
     */
    @Override
    public int deletePointsPackageByPackageIds(Long[] packageIds)
    {
        return pointsPackageMapper.deletePointsPackageByPackageIds(packageIds);
    }

    /**
     * 删除积分充值套餐信息
     * 
     * @param packageId 积分充值套餐主键
     * @return 结果
     */
    @Override
    public int deletePointsPackageByPackageId(Long packageId)
    {
        return pointsPackageMapper.deletePointsPackageByPackageId(packageId);
    }
}
